﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ftp_server
{
    public partial class AddUser : Form
    {
        public string name { set; get; }
        public string pass { set; get; }
        public Dictionary<string, string> Users = new Dictionary<string, string>();//用户名和密码
        public AddUser()
        {
            InitializeComponent();
        }

        private void AddUser_Load(object sender, EventArgs e)
        {
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            name = this.textBox1.Text;
            pass = this.textBox2.Text;
            if (Users.ContainsKey(name))
            {
                MessageBox.Show("用户名已存在");
            }
            else
            {
                Users.Add(name, pass);
                MessageBox.Show("添加成功");
                this.Close();
            }
        }
    }
}
